<template>
  <h1>医嘱 - 跟随框组件</h1>
  {{ "odType" + odType }}
  <f-select
    class="w100"
    optionFilterProp="name"
    v-model:value="odType"
    :options="typeList"
    :fieldNames="{ label: 'name', value: 'id' }"
  />
  <f-follow-entrust
    ref="tableFollowRef"
    class="w300"
    placeholder="请输入搜索内容A"
    v-model:value="entrust"
    :odType="odType"
    :visitInfo="visitInfo"
    @change="handleChange"
  />
  <pre>{{ result }}</pre>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { http } from "../../packages/index";

const odType = ref();
const entrust = ref();
const typeList = ref([]);
const tableFollowRef = ref();
const result = ref();
const visitInfo = ref({
  visitType: '21'
});
const patientInfo = ref({
  gender: '1'
});


http.post('/base/oditemtypes/queryOrderList', {})
  .then((res: any) => {
    typeList.value = res.isSuccess ? res.data : []
  });

const handleChange = (e) => {
  console.log('handleChange', e);
  odType.value = e.odType;
  result.value = e;
};

const handleInput = () => {
  tableFollowRef.value.search();
}

</script>
<style>
</style>